<template>
  <div class="app-container">
    <MyHeader color="red" title="京东"></MyHeader>
    <MyGoods :goods="item" v-for="item in list" :key="item.id"></MyGoods>
    <MyFooter :goods="list"></MyFooter>
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader.vue";
import MyGoods from "./components/MyGoods.vue";
import MyFooter from "./components/MyFooter.vue";
export default {
  name: "ShoppingApp",
  components: {
    MyHeader,
    MyGoods,
    MyFooter,
  },
  data() {
    return {
      list: [],
    };
  },

  mounted() {},

  methods: {},
  async created() {
    let res = await this.$axios({
      method: "get",
      url: "/api/cart",
    });
    console.log(res.data.list);
    this.list = res.data.list;
  },
};
</script>

<style lang="less" scoped>
.app-container {
  padding-top: 45px;
  padding-bottom: 50px;
}
</style>
